<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			<h2>四舍五入</h2>
			<input type="text" v-model="price" />
			<h2>{{ price | filterA }}</h2>
		</div>
		<script src="vue.js"></script>
		<script>
			var app = new Vue({
				el: "#app",
				data: {
					price: 0
				},
				filters: {
					filterA: function(value) {
						if (value == '') {
							return
						}
						return parseFloat(value).toFixed(2) + "元";
					}
				}
			})
		</script>
	</body>
</html>
